package cn.wawi.controller.data;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import cn.wawi.common.easyui.DataGrid;
import cn.wawi.controller.BaseController;
import cn.wawi.entity.data.QuestionOption;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/data_qOption")
public class QuestionOptionController extends BaseController<QuestionOption>{
	
	
	@InitBinder({"questionBank"})
	public void initBinder(WebDataBinder binder) {
		binder.setFieldDefaultPrefix("questionBank.");

	}
	
	@ResponseBody
	@RequestMapping(value="/list",method=RequestMethod.GET)
	public DataGrid list(HttpServletRequest request){
		return findAllByPage(request);
	}
	
	@ResponseBody
	@RequestMapping(value="/list1",method=RequestMethod.GET)
	public List<QuestionOption> list1(long bankId){
		Map<String,Object> map=new HashMap<String,Object>();
		map.put("ques_id1", bankId);
		return questionOptionDao.findAll(map);
	}
}
